[mirrors]
https://www.hiawatha-webserver.org/files/hiawatha-9.15.tar.gz

[vars]
filesize=869922
sha512=e5f0459475863c7cb2d15bdf2a9712f13c96ac450f349fd89e60fd600aad9010f25182aa6353a3014069a9798544a56ef79695918613946b63fecd3806b1982b

[deps.host]
cmake

[deps]
mbedtls


[build]
# NOTE: the mirror requires tls, download with curl:
#       USE_CURL=1 butch install hiawatha
# NOTE: XSLT support requires libxlst
# NOTE about mbedtls:
# Hiawatha usually compiles its own mbedtls to make sure it has the
# right config options. In sabotage, we already have these options set,
# so we use the system library of course.

CFLAGS="-static" cmake \
	-DENABLE_CACHE=OFF \
	-DENABLE_RPROXY=ON \
	-DENABLE_TOOLKIT=OFF \
	-DENABLE_XSLT=OFF \
	-DUSE_SYSTEM_MBEDTLS=ON \
	-DCMAKE_INSTALL_PREFIX="$butch_prefix" \
	-DCMAKE_INSTALL_BINDIR="$butch_prefix/bin" \
	-DCMAKE_INSTALL_SBINDIR="$butch_prefix/bin" \
	-DCMAKE_INSTALL_SYSCONFDIR="$butch_prefix/etc/hiawatha" \
	-DCMAKE_INSTALL_LIBDIR="$butch_prefix/lib" \
	-DCMAKE_INSTALL_MANDIR="$butch_prefix/share/man" \
	-DCONFIG_DIR="$butch_prefix/etc/hiawatha" \
	-DLOG_DIR="$butch_prefix/var/log/hiawatha" \
	-DPID_DIR="$butch_prefix/var/run/hiawatha" \
	-DWEBROOT_DIR="$butch_prefix/var/www" \

make V=1 -j$MAKE_THREADS

# set the user-id to www-data (as in the service)
sed -i 's/#ServerId = www-data/ServerId = www-data/' config/hiawatha.conf

make DESTDIR="$butch_install_dir" install

# install the service
IS="$K"/bin/install-service
"$IS" --down --log --force hiawatha "$K"/services/hiawatha
